package bookez.model.dao.generic;

import java.io.Serializable;

import bookez.model.exception.DataAccessLayerException;

public interface GenericDao<T, PK extends Serializable> {

    /**
     * Persist a newInstance object into database
     */
    PK create(T newInstance) throws DataAccessLayerException;

    /**
     * Retrieve an object that was previously persisted into database using
     * indicated primary key "id".
     */
    T read(PK id) throws DataAccessLayerException;

    /**
     * Save changes made to a persistent object.
     */
    void update(T transientOjbect) throws DataAccessLayerException;

    /**
     * Remove an persistent object from database
     */
    void delete(T persistentObject) throws DataAccessLayerException;
}// end interface GenericDao
